package com.wnxy.admin.common.log;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class LocalIPUtil {
    public static String getLocalIpAddress() {
        try {
            InetAddress localhost = InetAddress.getLocalHost();
            return localhost.getHostAddress();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        return "127.0.0.1"; // 或者返回一个默认的IP地址
    }
}
